package com.party.core.service.crowdfund;

import com.party.core.model.activity.Activity;
import com.party.core.model.crowdfund.CrowdfundRank;
import com.party.core.model.crowdfund.Project;
import com.party.core.model.crowdfund.Support;
import com.party.core.model.crowdfund.TargetProject;
import com.party.core.service.IBaseService;

import java.util.List;

/**
 * @Author: Administrator.
 * @Description: 众筹排名
 * @Date:Created in 2017/9/26 0026 上午 9:48.
 */
public interface ICrowdfundRankService extends IBaseService<CrowdfundRank> {
    CrowdfundRank getCrowdRank(CrowdfundRank rank, int percent);

    List<CrowdfundRank> findByEventId(String eventId);

    List<CrowdfundRank> findByTargetId(String targetId);

    /**
     * 保存众筹排名
     *
     * @param percent  排名
     * @param payment  阶段金额
     * @param eventId  众筹事项
     * @param targetId 众筹项目
     * @param support  支持者
     * @param project  众筹
     */
    void insertCrowdRank(Integer percent, Float payment, String eventId, String targetId, Support support, Project project);

    /**
     * 保存众筹排名
     *
     * @param afterPercent
     * @param beforePercent
     * @param activity
     * @param targetProject
     * @param support
     * @param project
     */
    void doCrowdRank(int afterPercent, int beforePercent, Activity activity, TargetProject targetProject, Support support, Project project);

    void deleteByProjectId(String projectId);
}
